{{ template "common/head.html" .title}}
<body>
{{ template "common/header.html" .userName }}

{{ template "common/search_bar.html" .goodsSKUCount}}

<div class="navbar_con">
    <div class="navbar">
        <h1 class="fl">全部商品分类</h1>
        <ul class="navlist fl">
            <li><a href="/">首页</a></li>
        </ul>
    </div>
</div>

<div class="center_con clearfix">
    <ul class="subnav fl">
        {{ range .goodsTypes }}
            <li><a href="/goods-list?type-id={{ .Id }}" class="fruit">{{ .Name }}</a></li>
        {{ end }}
    </ul>
    <div class="slide fl">
        <ul class="slide_pics">
            {{ range .indexGoodsBanners }}
                <li><img src="http://192.168.181.130:8888/{{ .Image }}" alt="幻灯片"></li>
            {{ end }}
        </ul>
        <div class="prev"></div>
        <div class="next"></div>
        <ul class="points"></ul>
    </div>
    <div class="adv fl">
        {{ range .indexPromotionBanners }}
            <a href="/"><img src="http://192.168.181.130:8888/{{ .Image }}"></a>
        {{ end }}
    </div>
</div>

{{ range .goods }}
    <div class="list_model">
        <div class="list_title clearfix">
            <h3 class="fl" id="model01"> {{ .type.Name }}</h3>
            <div class="subtitle fl">
                <span>|</span>
                {{ range .textGoods }}
                    <a href="/goods-detail?id={{ .GoodsSKU.Id }}">{{ .GoodsSKU.Name }}</a>
                {{ end }}
            </div>
            <a href="/goods-list?type-id={{ .type.Id }}" class="goods_more fr" id="fruit_more">查看更多 ></a>
        </div>

        <div class="goods_con clearfix">
            <div class="goods_banner fl"><img src="http://192.168.181.130:8888/{{ .type.Image }}"></div>
            <ul class="goods_list fl">
                {{ range .imageGoods }}
                    <li>
                        <h4><a href="/goods-detail?id={{ .GoodsSKU.Id }}">{{ .GoodsSKU.Name }}</a></h4>
                        <a href="/goods-detail?id={{ .GoodsSKU.Id }}"><img src="http://192.168.181.130:8888/{{ .GoodsSKU.Image }}"></a>
                        <div class="prize">¥ {{ .GoodsSKU.Price }}</div>
                    </li>
                {{ end }}
            </ul>
        </div>
    </div>
{{ end }}

{{ template "common/footer.html"}}
<script type="text/javascript" src="/static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/static/js/slide.js"></script>
<script type="text/javascript">
    BCSlideshow('focuspic');
    var oFruit = document.getElementById('fruit_more');
    var oShownum = document.getElementById('show_count');

    var hasorder = localStorage.getItem('order_finish');

    if (hasorder) {
        oShownum.innerHTML = '2';
    }

    oFruit.onclick = function () {
        window.location.href = 'list.html';
    }
</script>
</body>
</html>